//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "FrmSpoud.h"
#include "MyData.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormSpoud *FormSpoud;

extern MyData* mydat;

//---------------------------------------------------------------------------
__fastcall TFormSpoud::TFormSpoud(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormSpoud::RadioButton1Click(TObject *Sender)
{
this->GroupBox1->Visible=true;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton2Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=true;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton3Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=true;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton4Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=true;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------


void My_update_form(TFormSpoud *mform) {

mform->Edit8->Text=mydat->new_foitit.onoma;
mform->Edit9->Text=mydat->new_foitit.eponimo;


mform->Edit10->Text=AnsiString((mydat->new_secd_foitit.lessons));


mform->Edit11->Text=mydat->new_secd_foitit.didaktra;
mform->Edit7->Text=mydat->new_secd_foitit.hasbrothers_id;

mform->Edit1->Text=mydat->hasoldSpd.old_odio_name;
mform->Edit2->Text =mydat->hasoldSpd.town_odio;
mform->Edit4->Text= mydat->hasoldSpd.vathmos_lesson;
mform->Edit3->Text= mydat->hasoldSpd.title_lesson;

mform->Edit5->Text = mydat->hasKatataksiSpd.etos_katat;
mform->Edit6->Text= mydat->hasKatataksiSpd.vathm_katat;


}


void __fastcall TFormSpoud::FormCreate(TObject *Sender)
{
My_update_form(this);

this->GroupBox1->Visible=true;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton5Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=true;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::Button2Click(TObject *Sender)
{

mydat->new_foitit.onoma=Edit8->Text;
mydat->new_foitit.eponimo=Edit9->Text;


mydat->new_secd_foitit.lessons=Edit10->Text;
Edit11->Text >> mydat->new_secd_foitit.didaktra;
Edit7->Text >> mydat->new_secd_foitit.hasbrothers_id;


mydat->hasoldSpd.old_odio_name= Edit1->Text;
mydat->hasoldSpd.town_odio =Edit2->Text;
mydat->hasoldSpd.vathmos_lesson= Edit4->Text;
mydat->hasoldSpd.title_lesson= Edit3->Text;

mydat->hasKatataksiSpd.etos_katat =Edit5->Text;
mydat->hasKatataksiSpd.vathm_katat =Edit6->Text;


}




//---------------------------------------------------------------------------

void __fastcall TFormSpoud::Button1Click(TObject *Sender)
{
//algorithmos ipologismou didaktrwn
Edit11->Text="30";
}
//---------------------------------------------------------------------------

